<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            height: 800px;
        }
        #b1 {
            background-color: pink;
        }
        #b2 {
            background-color: red;
        }
        #b3 {
            background-color: orange;
        }
        #b4 {
            background-color: skyblue;
        }
        .side-bar {
            position: fixed;
            top: 0;
            right: 0;
            background-color: #fff;
        }
    </style>
</head>

<body>

    <div class="side-bar">
        <a href="#b1">b1</a>
        <a href="#b2">b2</a>
        <a href="#b3">b3</a>
        <a href="#b4">b4</a>
    </div>

    <div class="box" id="b1"></div>
    <div class="box" id="b2"></div>
    <div class="box" id="b3"></div>
    <div class="box" id="b4"></div>

</body>
</html>